package com.xungou.comment.controller;

import com.xungou.comment.pojo.Comment;
import com.xungou.comment.service.ICommentService;
import com.xungou.good.pojo.Good;
import com.xungou.goodtypeproperty.service.IGoodTypePropertyService;
import com.xungou.resource.service.IResourceService;
import com.xungou.score.pojo.Score;
import com.xungou.shop.pojo.Shop;
import com.xungou.shop.service.IShopService;
import com.xungou.utils.FileUtil;
import com.xungou.utils.UserUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/comment")
public class CommentController {
    @Resource
    private ICommentService commentService;

    @ResponseBody
    @RequestMapping(value = "/add")
    public Map<String, Object> add(Comment comment, Score score, @RequestParam Map<String, String> params) {
        return commentService.add(comment, score, params);
    }

    @ResponseBody
    @RequestMapping(value = "/list")
    public List<Map<String, Object>> list(@RequestParam Map<String, String> params) {
        return commentService.list(params);
    }
}